<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="UTF-8">
        <title>欢迎页面</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <meta http-equiv='refresh' content='60'>
        <link rel="stylesheet" th:href="@{/asserts/css/adminfont.css}">
        <link rel="stylesheet" th:href="@{/asserts/css/xadmin.css}">
        <script th:src="@{/asserts/lib/layui/layui.js}" charset="utf-8"></script>
        <script th:src="@{/asserts/js/xadmin.js}"  type="text/javascript" ></script>
		<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
		<script type="text/javascript">
		setInterval("nowtime.innerHTML=new Date().toLocaleString()",1000);
		</script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            <p><blockquote id="block" class="layui-elem-quote">欢迎管理员:</blockquote>
                                <span class="x-red"></span>  <br>现在时间:<span id="nowtime"></span></p>
                            </blockquote>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md12">
                
                    <div class="layui-card">
                        <div class="layui-card-header">数据统计</div>
                        <div class="layui-card-body ">
                            <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>用户数目</h3>
                                        <p id="usercount">
                                            <cite></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>待审核结伴数</h3>
                                        <p id="company_0">
                                            <cite></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>待审核游记数</h3>
                                        <p id="note_0">
                                            <cite></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>景点数</h3>
                                        <p id="attraction">
                                            <cite></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>攻略数</h3>
                                        <p id="strategy">
                                            <cite></cite></p>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                
                
                <div class="layui-col-md12">
                
                    <div class="layui-card">
                        <div class="layui-card-header">已审核</div>
                        <div class="layui-card-body ">
                            <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>已审核结伴数</h3>
                                        <p id="company">
                                            <cite></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>已审核游记数</h3>
                                        <p id="note">
                                            <cite></cite></p>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                
                <div class="layui-col-sm6 layui-col-md3">   
                </div>
            </div>
        </div>
        </div>
        <script type="text/javascript">
        $(document).ready(function(){
        	var url=window.location.href;
            var index=url.indexOf('=');
            var param=url.substr(index+1);
            $("#block").append(param);
            
            $.ajax({
            	type: "post",
    	        url: "/admin/getCounts",
    	        data:JSON.stringify({id:0}),
    	        contentType: "application/json",
    	        dataType: "json",
    	        async: true,
        	    success: function (data) {
        	    	$("#usercount").html(data.usercount);
        	    	$("#company_0").html(data.company_0);
        	    	$("#company").html(data.company);
        	    	$("#note_0").html(data.note_0);
        	    	$("#note").html(data.note);
        	    	$("#strategy").html(data.strategy);
        	    	$("#attraction").html(data.attraction);
        	    },
        	    error: function (e) {
        	    	console.log("数据禁止访问!");
        	    }	
        	});
            
        })
        
        
        </script>
    </body>
</html>